package com.gurid.service.ucenter.controller.admin;

import com.gurid.common.base.result.R;
import com.gurid.service.ucenter.service.MemberService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Tag(name = "MemberController", description = "会员管理")
//@CrossOrigin
@RestController
@RequestMapping("/admin/ucenter/member")
@Slf4j
public class MemberController {

    @Autowired
    private MemberService memberService;

    @Operation(summary = "每日会员注册数量")
    @GetMapping("count-register-num/{day}")
    public R countRegisterNum(
            @Parameter(description = "日期", required = true)
            @PathVariable String day) {
        Integer registerNum = memberService.countRegisterNum(day);
        return R.ok().data("registerNum", registerNum);
    }
}
